﻿package plugin.instances.game
{
    import com.core.*;
    import com.sh.game.util.*;
    import flash.utils.*;
    import morn.core.handlers.*;
    import plugin.instances.*;
    import uiresource.instances.ui.*;

    public class SmmzGame extends SmmzUI implements IInstance
    {

        public function SmmzGame()
        {
            return;
        }// end function

        public function initShow(param1:Object, param2:Dictionary) : void
        {
            if (param2[InstancesPublic.SMMZROOM])
            {
                this.updateShow(InstancesPublic.SMMZROOM, param2[InstancesPublic.SMMZROOM]);
            }
            return;
        }// end function

        public function updateShow(param1:int, param2:Object) : void
        {
            switch(param1)
            {
                case InstancesPublic.TIMECHECKER:
                {
                    txt_time.text = TimeDataFormatUtil.getLeftTime(int(param2));
                    break;
                }
                case InstancesPublic.SMMZROOM:
                {
                    txt_room.text = param2 + "";
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        public function destroyShow(param1:Dictionary) : void
        {
            return;
        }// end function

        public function initEvent() : void
        {
            btn_tuichu.clickHandler = new Handler(this.doTuichu);
            return;
        }// end function

        private function doTuichu() : void
        {
            ModelProxy.change("zone", "exitInstance", null);
            return;
        }// end function

        public function removeEvent() : void
        {
            return;
        }// end function

    }
}
